package com.zf.yichat.model;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.*;

@Table(name = "st_mall_order")
public class StMallOrder implements Serializable {
    @Id
    private Long id;

    @Column(name = "user_id")
    private Long userId;

    private String orderNo;

    /**
     * 订单金额
     */
    @Column(name = "order_amount")
    private BigDecimal orderAmount;

    /**
     * 优惠金额
     */
    @Column(name = "discounts_amount")
    private BigDecimal discountsAmount;

    /**
     * 支付金额
     */
    @Column(name = "pay_amount")
    private BigDecimal payAmount;

    /**
     * 商品ID
     */
    @Column(name = "goods_id")
    private Integer goodsId;

    /**
     * 商品数量
     */
    @Column(name = "goods_count")
    private Integer goodsCount;

    /**
     * 寄返方式
     */
    @Column(name = "ems_type")
    private String emsType;

    /**
     * 支付时间
     */
    @Column(name = "pay_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date payTime;

    private static final long serialVersionUID = 1L;

    public StMallOrder(Long id, Long userId,String orderNo, BigDecimal orderAmount, BigDecimal discountsAmount, BigDecimal payAmount, Integer goodsId, Integer goodsCount, String emsType, Date payTime) {
        this.id = id;
        this.userId = userId;
        this.orderNo = orderNo;
        this.orderAmount = orderAmount;
        this.discountsAmount = discountsAmount;
        this.payAmount = payAmount;
        this.goodsId = goodsId;
        this.goodsCount = goodsCount;
        this.emsType = emsType;
        this.payTime = payTime;
    }

    public StMallOrder() {
        super();
    }

    /**
     * @return id
     */
    public Long getId() {
        return id;
    }

    /**
     * @param id
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * @return user_id
     */
    public Long getUserId() {
        return userId;
    }

    /**
     * @param userId
     */
    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    /**
     * 获取订单金额
     *
     * @return order_amount - 订单金额
     */
    public BigDecimal getOrderAmount() {
        return orderAmount;
    }

    /**
     * 设置订单金额
     *
     * @param orderAmount 订单金额
     */
    public void setOrderAmount(BigDecimal orderAmount) {
        this.orderAmount = orderAmount;
    }

    /**
     * 获取优惠金额
     *
     * @return discounts_amount - 优惠金额
     */
    public BigDecimal getDiscountsAmount() {
        return discountsAmount;
    }

    /**
     * 设置优惠金额
     *
     * @param discountsAmount 优惠金额
     */
    public void setDiscountsAmount(BigDecimal discountsAmount) {
        this.discountsAmount = discountsAmount;
    }

    /**
     * 获取支付金额
     *
     * @return pay_amount - 支付金额
     */
    public BigDecimal getPayAmount() {
        return payAmount;
    }

    /**
     * 设置支付金额
     *
     * @param payAmount 支付金额
     */
    public void setPayAmount(BigDecimal payAmount) {
        this.payAmount = payAmount;
    }

    /**
     * 获取商品ID
     *
     * @return goods_id - 商品ID
     */
    public Integer getGoodsId() {
        return goodsId;
    }

    /**
     * 设置商品ID
     *
     * @param goodsId 商品ID
     */
    public void setGoodsId(Integer goodsId) {
        this.goodsId = goodsId;
    }

    /**
     * 获取商品数量
     *
     * @return goods_count - 商品数量
     */
    public Integer getGoodsCount() {
        return goodsCount;
    }

    /**
     * 设置商品数量
     *
     * @param goodsCount 商品数量
     */
    public void setGoodsCount(Integer goodsCount) {
        this.goodsCount = goodsCount;
    }

    /**
     * 获取寄返方式
     *
     * @return ems_type - 寄返方式
     */
    public String getEmsType() {
        return emsType;
    }

    /**
     * 设置寄返方式
     *
     * @param emsType 寄返方式
     */
    public void setEmsType(String emsType) {
        this.emsType = emsType == null ? null : emsType.trim();
    }

    /**
     * 获取支付时间
     *
     * @return pay_time - 支付时间
     */
    public Date getPayTime() {
        return payTime;
    }

    /**
     * 设置支付时间
     *
     * @param payTime 支付时间
     */
    public void setPayTime(Date payTime) {
        this.payTime = payTime;
    }
}